package com.hzcx.app.simplechat.ui.setting.presenter;

import android.content.Context;

import com.hzcx.app.simplechat.api.BaseDialogObserver;
import com.hzcx.app.simplechat.base.BaseEmptyBean;
import com.hzcx.app.simplechat.base.BasePresenter;
import com.hzcx.app.simplechat.model.PublicModel;
import com.hzcx.app.simplechat.model.SettingModel;
import com.hzcx.app.simplechat.ui.publicui.bean.ProtocolBean;
import com.hzcx.app.simplechat.ui.publicui.bean.UpdateVersionBean;
import com.hzcx.app.simplechat.ui.setting.bean.BatchClearListBean;
import com.hzcx.app.simplechat.ui.setting.contract.AboutContract;
import com.hzcx.app.simplechat.ui.setting.contract.BatchClearContract;
import com.hzcx.app.simplechat.util.app.AppHelper;

import java.util.List;

public class BatchClearPresenter extends BasePresenter<BatchClearContract.View> implements BatchClearContract.Presenter {

    /**
     * 批量清除
     *
     * @param context
     */
    @Override
    public void batchClear(Context context, int cancel_id) {
        SettingModel.batchClear(context, cancel_id, new BaseDialogObserver<BaseEmptyBean>(context) {
            @Override
            protected void onSuccess(BaseEmptyBean data) {
                mView.clearSuccess();
            }
        });
    }

    /**
     *  获取清除列表
     * @param context
     * @param type
     */
    @Override
    public void getBatchClearList(Context context, int type) {
        SettingModel.getBatchClearList(context, type, new BaseDialogObserver<List<BatchClearListBean>>(context) {
            @Override
            protected void onSuccess(List<BatchClearListBean> data) {
                mView.clearListResult(data);
            }
        });
    }
}
